import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 订单模块-店铺信息
 */
@Entity('order_shop')
export class OrderShopEntity extends BaseEntity {
  @Column({ comment: '名称', default: '' })
  name: string;

  // 城市
  @Column({ comment: '城市', nullable: true })
  city: string;

  // 城市ID
  @Column({ comment: '城市ID', default: 0 })
  cityId: number;

  @Column({ comment: '地址', default: '' })
  address: string;

  @Column({ comment: '电话', length: 20, default: '' })
  phone: string;

  @Column({ comment: '头图', default: '' })
  headerImage: string;

  @Column({ comment: '详情图', type: 'json', nullable: true })
  detailImages: string[];

  @Column({ comment: '负责人', nullable: true })
  principal: string;

  // 接诊时段
  @Column({ comment: '接诊时段', nullable: true })
  acceptTime: string;

  // 代理商商户ID
  @Column({ comment: '代理商商户ID', default: 0 })
  agentMerchantId: number;

  // 支付商户ID
  @Column({ comment: '支付商户ID', default: 0 })
  payMerchantId: number;

  @Column({
    comment: '经度',
    type: 'decimal',
    precision: 10,
    scale: 7,
    nullable: true,
  })
  longitude: number;

  @Column({
    comment: '纬度',
    type: 'decimal',
    precision: 10,
    scale: 7,
    nullable: true,
  })
  latitude: number;

  // 收货人
  @Column({ comment: '收货人', nullable: true })  
  contactName: string;

  // 收货电话
  @Column({ comment: '收货电话', nullable: true })
  contactPhone: string;
  
  // 收货地址
  @Column({ comment: '收货地址', nullable: true })
  receiveAddress: string;

  // 商品ID
  @Column({ comment: '商品ID', default: 0 })
  goodsId: number;

  // 代理商ID
  @Column({ comment: '代理商ID', default: 0 })
  agentId: number;
}
